var t = getApp();

Page({
  data: {
    wzname: "",
    arr:[
      {
        userId:1,
        userIcon: '/assets/images/head.png',
        name:'小明',
        nmGender:'男',
        age:30,
        remarkName:'心脏病'
      },
      {
        userId: 1,
        userIcon: '/assets/images/head.png',
        name: '小明',
        nmGender: '女',
        age: 30,
        remarkName: '心脏病'
      },
      {
        userId: 1,
        userIcon: '/assets/images/head.png',
        name: '小明',
        nmGender: '男',
        age: 30,
        remarkName: '心脏病'
      },
      {
        userId: 1,
        userIcon: '/assets/images/head.png',
        name: '小明',
        nmGender: '男',
        age: 30,
        remarkName: '心脏病'
      }
    ]
  },
  input: function(t) {
    console.log(t.detail.value), this.setData({
      wzname: t.detail.value
    });
  },
  grabble: function(a) {
    var e = this,
      o = wx.getStorageSync("log") || "";
    wx.request({
      url: t.globalData.dic + "doctor/manage/searchMyPatient",
      data: {
        token: o,
        keyWord: wx.getStorageSync("input") || ""
      },
      method: "POST",
      header: {
        "Content-Type": "application/x-www-form-urlencoded"
      },
      success: function(t) {
        console.log(t.data.data), 0 == t.data.data.length ? wx.showToast({
          title: "查无此人",
          icon: "none",
          duration: 2e3
        }) : e.setData({
          arr: t.data.data
        });
      }
    });
  },
  shu: function(a) {
    console.log(a.currentTarget.dataset.patientid), wx.request({
      url: t.globalData.dic + "doctor/manage/showPatientAllowArchives/" + a.currentTarget.dataset.patientid,
      success: function(t) {
        console.log(t.data.data), 1 != t.data.data ? wx.showModal({
          title: "提示",
          content: "患者没有授权",
          success: function(t) {
            t.confirm ? console.log("用户点击确定") : t.cancel && console.log("用户点击取消");
          }
        }) : (wx.setStorageSync("patientId", a.currentTarget.dataset.patientid), wx.navigateTo({
            url: "/hyb_yl/followUp/pages/healthRecord/healthRecord"
        }));
      }
    });
  },
  Wmovement: function(t) {
    console.log(t.currentTarget.dataset.patientid), wx.setStorageSync("patientid", t.currentTarget.dataset.patientid),
      wx.navigateTo({
      url: "/hyb_yl/backstageFollowUp/pages/casControlmovement/casControlmovement"
      });
  },
  onLoad: function(options) {
    var that=this
    var sousuinfo = JSON.parse(options.sousuinfo);
    that.setData({
      arr: sousuinfo
    })
  },
  onShow: function() {}
});